-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move BankHashStats from account's db to bank #3821
Conversation
c7915ec
to
56713c1
Compare
9fb34ac
to
863005e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we're missing updating the slot's bank_hash_stats in two other places:
- store_stake_accounts()
- commit_transactions()
Both of these functions call into accounts/accountsdb directly, so they bypass the Bank::store_accounts() logic.
done in 284e738 |
The log for BankHashStats matched with master when running on mainnet.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic looks correct now. We should test this against another node on mnb to ensure both produce the same bank hash stats, as these numbers are used to debug consensus mismatches.
Can you run master vs this PR and ensure the bank hash details that are logged in the "bank frozen" line are always the same? Ideally over an epoch boundary, since that'll exercise also storing the stake accounts.
Edit: Nice! I see you just did this test: #3821 (comment)
Yes. I will keep it running and check for the slot at the next epoch boundary, which is about 1d7h from now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Probably best to wait and confirm the stats match master across an epoch boundary.
stats matched at the epoch boundary.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine by me. only used for debugging.
Problem
We keep track of bank_hash_stats for each bank. Currently, this stats live inside a locked hash map in Accounts DB. This cause a lock contention for every store of an accounts and hurts performance.
We want to get rid of the lock in the store code path.
Summary of Changes
Move bank_hash_stats from accounts db to bank.
Introduce AtomicBankHashStats to accumulate the stats in the bank.
Fixes #